﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="login.aspx.cs" Inherits="ShareMarking.ShowqrCode.login" %>

<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>美赞臣</title>
    <link href="css/style.css" rel="stylesheet"/>
    <script src="js/jquery.min.js" type="text/javascript"></script>
    <script src="js/adaptive.js"></script>
</head>
<body>
<form id="form1" runat="server">
    <div class="wrap">
        <div class="main-border">
            <div class="from-border">
                <label class="lable-text">工号 :</label>
                <input class="input-text" id="txt_nccode" type="text" placeholder="请输入工号"/>
            </div>
            <div class="btm-border">
                <input class="btn-input" id="btn_submit" type="button" value="确定"/>
            </div>
        </div>
    </div>
</form>


<script>
    $("#btn_submit").click(submit);
    function submit() {
        $.ajax({
            type: "post",
            url: "api.ashx?method=login",
            dataType: "json",
            data: { nccode: $('#txt_nccode').val() },
            success: function (result) {
                if (result.status == 0) {
                    location.href = "show.aspx?imgurl=" + result.code_url + "&nccode=" + $('#txt_nccode').val();
                }
                else {
                    location.href = "back.html";
                }
            }
        });
    }
</script>

</body>
</html>